]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Change setDummyCursorPosition to also set the size
authorRui Matos <tiagomatos@gmail.com>
Fri, 11 Apr 2014 14:12:52 +0000 (16:12 +0200)
committerRui Matos <tiagomatos@gmail.com>
Fri, 11 Apr 2014 14:54:01 +0000 (16:54 +0200)
If we are being used to follow a text entry cursor we also need to set
the size so that the popup menu avoids covering it.

https://bugzilla.gnome.org/show_bug.cgi?id=727579

js/ui/backgroundMenu.js
js/ui/ibusCandidatePopup.js
js/ui/layout.js

index 71251e5bb7b24eddbf13d6d5f370e001c50d2f92..b3dec1ce2e7685be1785aef4a50e1730f316dd9a 100644 (file)
@@ -35,7 +35,7 @@ function addBackgroundMenu(actor, layoutManager) {
 
     function openMenu() {
         let [x, y] = global.get_pointer();
-        Main.layoutManager.setDummyCursorPosition(x, y);
+        Main.layoutManager.setDummyCursorGeometry(x, y, 0, 0);
         actor._backgroundMenu.open(BoxPointer.PopupAnimation.NONE);
     }
 
index 01884f5d46e9e6e26c6e42150c3f98bf5d89d70f..ded7cb830f2570985be8dec5a51fcfe7ff0eaf84 100644 (file)
@@ -155,7 +155,7 @@ const CandidatePopup = new Lang.Class({
 
         panelService.connect('set-cursor-location',
                              Lang.bind(this, function(ps, x, y, w, h) {
-                                 Main.layoutManager.setDummyCursorPosition(x, y);
+                                 Main.layoutManager.setDummyCursorGeometry(x, y, w, h);
                                  if (this._boxPointer.actor.visible)
                                      this._boxPointer.setPosition(Main.layoutManager.dummyCursor, 0);
                              }));
index 3901c9f473b20b713f1f55798dbf3264d0553b7f..80428a586f48c46f7231461e66de8970847a5efd 100644 (file)
@@ -223,7 +223,7 @@ const LayoutManager = new Lang.Class({
         this._keyboardHeightNotifyId = 0;
 
         // A dummy actor that tracks the mouse or text cursor, based on the
-        // position set in setDummyCursorPosition.
+        // position and size set in setDummyCursorGeometry.
         this.dummyCursor = new St.Widget({ width: 0, height: 0 });
         this.uiGroup.add_actor(this.dummyCursor);
 
@@ -729,7 +729,7 @@ const LayoutManager = new Lang.Class({
         this._updateRegions();
     },
 
-    // setDummyCursorPosition:
+    // setDummyCursorGeometry:
     //
     // The cursor dummy is a standard widget commonly used for popup
     // menus and box pointers to track, as the box pointer API only
@@ -738,9 +738,10 @@ const LayoutManager = new Lang.Class({
     // is what you should use. Given that the menu should not track
     // the actual mouse pointer as it moves, you need to call this
     // function before you show the menu to ensure it is at the right
-    // position.
-    setDummyCursorPosition: function(x, y) {
+    // position and has the right size.
+    setDummyCursorGeometry: function(x, y, w, h) {
         this.dummyCursor.set_position(Math.round(x), Math.round(y));
+        this.dummyCursor.set_size(Math.round(w), Math.round(h));
     },
 
     // addChrome: